﻿using System.ComponentModel.DataAnnotations;

namespace _2
{
    internal class Program
    {
        class ArrMath
        {
            public int GetSize()
            {
                int n=0;
                string s = "";
                Console.Write("Please enter the size of the array:");
                s = Console.ReadLine();
                n = int.Parse(s);
                return n;
            }
            public int[] GetArr(int n)
            {
                Console.Write("Please enter the array:");
                string s = "";
                s = Console.ReadLine();
                string[] arr1 = s.Split(' ');
                int len = arr1.Length;
                int[] arr2 = new int[len];
                for (int i = 0; i < len; i++)
                {
                    arr2[i] = int.Parse(arr1[i]);
                }
                return arr2;
            }
            public void GetMaxorMin(int[] arr,out int Max,out int Min)
            {
                int max = arr[0];
                int min = arr[0];
                int len = arr.Length;
                for (int i = 0; i < len; i++)
                {
                    if (arr[i] > max)
                    {
                        max = arr[i];
                    }
                    else
                        min = arr[i];
                }
                Max = max;
                Min = min;
            }
            public void GetSumorAvg(int[] arr, out int sum, out double avg)
            {
                int Sum = 0;
                double Avg = 0;
                int len = arr.Length;
                for (int i = 0; i < len; i++)
                    Sum += arr[i];
                Avg = Sum / len;
                sum = Sum;
                avg = Avg;
            }
        }
        static void Main(string[] args)
        {
            ArrMath obj = new ArrMath();
            int n=obj.GetSize();
            int[] arr = new int[n];
            arr=obj.GetArr(n);
            int max = 0;int min = 0;
            int sum = 0;double avg = 0;
            obj.GetMaxorMin(arr, out max, out min);
            obj.GetSumorAvg(arr, out sum, out avg);
            Console.WriteLine("The maxium number of the array is:" + max);
            Console.WriteLine("The minium number of the array is:" + min);
            Console.WriteLine("The sum number of the array is:" + sum);
            Console.WriteLine("The average number of the array is:" + avg);
        }
    }
}
